const mongoose = require('mongoose')
const schema = new mongoose.Schema({
  username: {
    type: String
  },
  password: {
    type: String,
    select:false,//不返回前端
    set(val){
      return require('bcryptjs').hashSync(val,10)//加密
    }
  }
})

module.exports = mongoose.model('AdminUser', schema)